(bug 11569) API Login should return the cookie prefix
authorRoan Kattouw <catrope@users.mediawiki.org>
Mon, 8 Oct 2007 18:00:17 +0000 (18:00 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Mon, 8 Oct 2007 18:00:17 +0000 (18:00 +0000)
RELEASE-NOTES
includes/api/ApiLogin.php

index 87b6d83..96ec3e8 100644 (file)
@@ -110,6 +110,7 @@ Full API documentation is available at http://www.mediawiki.org/wiki/API
 * Include svn revision number (if install is checked-out from svn) in siteinfo query.
 * (bug 11173) Allow limited wikicode rendering via api.php
 * (bug 11572) API should provide interface for expanding templates
+* (bug 11569) Login should return the cookie prefix 
 
 === Languages updated in 1.12 ===
 
index d62fbfb..851b531 100644 (file)
@@ -94,7 +94,7 @@ class ApiLogin extends ApiBase {
                $loginForm = new LoginForm($params);
                switch ($loginForm->authenticateUserData()) {
                        case LoginForm :: SUCCESS :
-                               global $wgUser;
+                               global $wgUser, $wgCookiePrefix;
 
                                $wgUser->setOption('rememberpassword', 1);
                                $wgUser->setCookies();
@@ -103,6 +103,8 @@ class ApiLogin extends ApiBase {
                                $result['lguserid'] = $_SESSION['wsUserID'];
                                $result['lgusername'] = $_SESSION['wsUserName'];
                                $result['lgtoken'] = $_SESSION['wsToken'];
+                               $result['cookieprefix'] = $wgCookiePrefix;
+                               $result['sessionid'] = $_COOKIE["{$wgCookiePrefix}_session"];
                                break;
 
                        case LoginForm :: NO_NAME :